//
//  MainViewController.swift
//  CXWeibo
//
//  Created by 陈旭 on 16/9/10.
//  Copyright © 2016年 陈旭. All rights reserved.
//

import UIKit

class MainViewController: UITabBarController {
    
    // MARK:- 懒加载
    private lazy var composeBtn : UIButton = UIButton(imageName: "tabbar_compose_icon_add", bgImageName: "tabbar_compose_button")
    
    // MARK:- 系统回调函数
    override func viewDidLoad() {
        super.viewDidLoad()
        
        // 设置发布按钮
        setupComposeBtn()
    }

}

// MARK:- 设置UI界面
extension MainViewController{
    private func setupComposeBtn(){
        tabBar.addSubview(composeBtn)
        composeBtn.center = CGPointMake(tabBar.center.x, tabBar.frame.size.height * 0.5)
        composeBtn.addTarget(self, action: "composeBtnClick", forControlEvents: .TouchUpInside)
    }
}

// MARK:- 事件监听
extension MainViewController{
    @objc private func composeBtnClick(){
        CXPrint("composeBtnClick")
    }
}
